
***************DO-File***********************

Chinese and U.S. FDI and Democracy (JAAS)

**********Control Variables******************

******Contol Variables for Main Models*******
clear 
use "C:\Users\lu3\OneDrive\Documents\Glen\Glen_Lance_demcoracy\JAAS\master.dta"

*****Use this syntax to generate the control variables for Tables 1-3 and A8 - A10*********

global control_pen "kaopen gdpgrowthannualnygdpmktpkdzg lngdppercap lntrade_gdp sluemtotlzs wdi_inflation primarycompletionratetotalofrel eeurop lamerica asia nafrme "


******Control Variables for Robustness Checks***************

****Use this syntax to generate the control variables for the Tables A2 - A4********

global control_pen "kaopen gdpgrowthannualnygdpmktpkdzg lngdppercap lntrade_gdp sluemtotlzs wdi_inflation primarycompletionratetotalofrel gini eeurop lamerica asia nafrme"

****Use this syntax to generate the control variables for the Tables A5 - A7********

global control_pen "kaopen gdpgrowthannualnygdpmktpkdzg lngdppercap lntrade_gdp sluemtotlzs wdi_inflation primarycompletionratetotalofrel gini china_fin_bln_usd_0510mean eeurop lamerica asia nafrme"


****************************************************************************

****Use this syntax to generate Tables********

outreg2 using Table2.doc, dec(3) replace	


******************************Polyarchy and China*************

*****Table 1**********
**Model 1   
ivreg2 v2x_polyarchy_1 $control_pen (lnQuantityinMillions_lag_1 = steel_lnQuantityinMillionsprob), robust first

**Model 15  
ivregress 2sls v2x_polyarchy_1 $control_pen (lnQuantityinMillions_lag_1 = steel_lnQuantityinMillionsprob), robust first

ivregress gmm v2x_polyarchy_1 $control_pen (lnQuantityinMillions_lag_1 = steel_lnQuantityinMillionsprob), robust first



*********SOEs and POEs***********

******Table A8 and A9*************

**Model 29
ivreg2 v2x_polyarchy_1 $control_pen (lnSOE_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first

ivregress 2sls v2x_polyarchy_1 $control_pen (lnSOE_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first

**Model 34
ivreg2 v2x_polyarchy_1 $control_pen (lnPrivate_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first
  
ivregress 2sls v2x_polyarchy_1 $control_pen (lnPrivate_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first


*************************Libdem and China**************

**********Table 1*********
**Model 2
ivreg2 v2x_libdem_1 $control_pen (lnQuantityinMillions_lag_1 = steel_lnQuantityinMillionsprob), robust first

**Model 16
ivregress 2sls v2x_libdem_1 $control_pen (lnQuantityinMillions_lag_1 = steel_lnQuantityinMillionsprob), first

ivregress gmm v2x_libdem_1 $control_pen (lnQuantityinMillions_lag_1 = steel_lnQuantityinMillionsprob), first


*********SOEs and POEs***********

*******Tables A8 and A9************
**Model 30
ivreg2 v2x_libdem_1 $control_pen (lnSOE_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first
  
ivregress 2sls v2x_libdem_1 $control_pen (lnSOE_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first


**Model 35
ivreg2 v2x_libdem_1 $control_pen (lnPrivate_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first
  
ivregress 2sls v2x_libdem_1 $control_pen (lnPrivate_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first


******************Participatory Democracy and China************

*********Table 1***********
**Model 3
ivreg2 v2x_partipdem_1  $control_pen (lnQuantityinMillions_lag_1 = steel_lnQuantityinMillionsprob), robust first

**Model 17
ivregress 2sls v2x_partipdem_1 $control_pen (lnQuantityinMillions_lag_1 = steel_lnQuantityinMillionsprob), first

ivregress gmm v2x_partipdem_1 $control_pen (lnQuantityinMillions_lag_1 = steel_lnQuantityinMillionsprob), first


*********SOEs and POEs***********

********Tables A8 and A9************
**Model 31
ivreg2 v2x_partipdem_1 $control_pen (lnSOE_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first
  
ivregress v2x_partipdem_1 $control_pen (lnSOE_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first


**Model 36
ivreg2 v2x_partipdem_1 $control_pen (lnPrivate_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first
  
ivregress 2sls v2x_partipdem_1 $control_pen (lnPrivate_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first


******************Deliberative Democracy and China************

******Table 1************
**Model 4
ivreg2 v2x_delibdem_1  $control_pen (lnQuantityinMillions_lag_1 = steel_lnQuantityinMillionsprob), robust first

**Model 18
ivregress 2sls v2x_delibdem_1 $control_pen (lnQuantityinMillions_lag_1 = steel_lnQuantityinMillionsprob), first

ivregress gmm v2x_delibdem_1 $control_pen lnQuantityinMillions_lag_1 = steel_lnQuantityinMillionsprob), first


*********SOEs and POEs***********

********Tables A8 and A9************

**Model 32
ivreg2 v2x_delibdem_1 $control_pen (lnSOE_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first

ivregress 2sls v2x_delibdem_1 $control_pen (lnSOE_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first


**Model 37
ivreg2 v2x_delibdem_1 $control_pen (lnPrivate_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first
  
ivregress 2sls v2x_delibdem_1 $control_pen (lnPrivate_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first


******************Egalitarian Democracy and China************

**********Table 1************
**Model 5 
ivreg2 v2x_egaldem_1 $control_pen (lnQuantityinMillions_lag_1 = steel_lnQuantityinMillionsprob), robust first

**Model 19
ivregress 2sls v2x_egaldem_1 $control_pen (lnQuantityinMillions_lag_1 = steel_lnQuantityinMillionsprob), first

ivregress gmm v2x_egaldem_1 $control_pen (lnQuantityinMillions_lag_1 = steel_lnQuantityinMillionsprob), first


*********SOEs and POEs***********

*******Tables A8 and A9*****************

**Model 33
ivreg2 v2x_egaldem_1 $control_pen (lnSOE_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first
  
ivregress 2sls v2x_egaldem_1 $control_pen (lnSOE_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first


**Model 38
ivreg2 v2x_egaldem_1 $control_pen (lnPrivate_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first
  
ivregress 2sls v2x_egaldem_1 $control_pen (lnPrivate_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first


***************************************************************

*******Rule of Law_4*************

******Table 3********
**Model 11
ivreg2 e_fh_rol $control_pen (lnQuantityinMillions_lag_1 = steel_lnQuantityinMillionsprob), robust first

**Model 25
ivregress 2sls e_fh_rol $control_pen (lnQuantityinMillions_lag_1 = steel_lnQuantityinMillionsprob), robust first


*********SOEs and POEs***********

*******Table A10**************

**Model 39
ivreg2 e_fh_rol $control_pen (lnSOE_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first
  
ivregress 2sls e_fh_rol $control_pen (lnSOE_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first

**Model 40
ivreg2 e_fh_rol $control_pen (lnPrivate_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first
  
ivregress 2sls e_fh_rol $control_pen (lnPrivate_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first


******Polcon III******************

******Table 3***********
**Model 13
ivreg2 h_polcon3 $control_pen (lnQuantityinMillions_lag_1 = steel_lnQuantityinMillionsprob), robust first

**Model 27
ivregress 2sls h_polcon3 $control_pen (lnQuantityinMillions_lag_1 = steel_lnQuantityinMillionsprob), robust first

ivregress gmm h_polcon3 $control_pen (lnQuantityinMillions_lag_1 = steel_lnQuantityinMillionsprob), robust first


*********SOEs and POEs***********

*******Table A10**************

**Model 41
ivreg2 h_polcon3 $control_pen (lnSOE_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first
  
ivregress 2sls h_polcon3 $control_pen (lnSOE_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first


**Model 42
ivreg2 h_polcon3 $control_pen (lnPrivate_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first
  
ivregress 2sls h_polcon3 $control_pen (lnPrivate_dollar_lag_1 = steel_lnQuantityinMillionsprob), robust first


**********************************************

U.S. Models

**********************************Polyarchy and US*************

******Table 2**********
**Model 6

ivreg2 v2x_polyarchy_1 $control_pen (usfdi_Mil_logged_lag_1 = steel_usfdi_Mil_loggedprob), robust first

**Model 20
ivregress 2sls v2x_polyarchy_1 $control_pen (usfdi_Mil_logged_lag_1 = steel_usfdi_Mil_loggedprob), robust first

ivregress gmm v2x_polyarchy_1 $control_pen (usfdi_Mil_logged_lag_1 = steel_usfdi_Mil_loggedprob), robust first


*************************Libdem and US**************

*******Table 2****************
**Model 7
ivreg2 v2x_libdem_1 $control_pen (usfdi_Mil_logged_lag_1 = steel_usfdi_Mil_loggedprob), robust first

**Model 21
ivregress 2sls v2x_libdem_1 $control_pen (usfdi_Mil_logged_lag_1 = steel_usfdi_Mil_loggedprob), first

ivregress gmm v2x_libdem_1 $control_pen (usfdi_Mil_logged_lag_1 = steel_usfdi_Mil_loggedprob), first


******************Participatory Democracy and US************

*******Table 2*************
**Model 8
ivreg2 v2x_partipdem_1  $control_pen (usfdi_Mil_logged_lag_1 = steel_usfdi_Mil_loggedprob), robust first

**Model 22
ivregress 2sls v2x_partipdem_1 $control_pen (usfdi_Mil_logged_lag_1 = steel_usfdi_Mil_loggedprob), first

ivregress gmm v2x_partipdem_1 $control_pen (usfdi_Mil_logged_lag_1 = steel_usfdi_Mil_loggedprob), first


******************Deliberative Democracy and US************

*******Table 2***********
**Model 9
ivreg2 v2x_delibdem_1  $control_pen (usfdi_Mil_logged_lag_1 = steel_usfdi_Mil_loggedprob), robust first

**Model 23
ivregress 2sls v2x_delibdem_1 $control_pen (usfdi_Mil_logged_lag_1 = steel_usfdi_Mil_loggedprob), first

ivregress gmm v2x_delibdem_1 $control_pen usfdi_Mil_logged_lag_1 = steel_usfdi_Mil_loggedprob), first


******************Egalitarian Democracy and US************

**************Table 2************

**Model 10
ivreg2 v2x_egaldem_1 $control_pen (usfdi_Mil_logged_lag_1 = steel_usfdi_Mil_loggedprob), robust first

**Model 24
ivregress 2sls v2x_egaldem_1 $control_pen (usfdi_Mil_logged_lag_1 = steel_usfdi_Mil_loggedprob), first

ivregress gmm v2x_egaldem_1 $control_pen (usfdi_Mil_logged_lag_1 = steel_usfdi_Mil_loggedprob), first


***************************************************************

*******Rule of Law_4*************

********Table 3*********
**Model 12
ivreg2 e_fh_rol $control_pen (usfdi_Mil_logged_lag_1 = steel_usfdi_Mil_loggedprob), robust first

**Model 26
ivregress 2sls e_fh_rol $control_pen (usfdi_Mil_logged_lag_1 = steel_usfdi_Mil_loggedprob), robust first


******Polcon III******************

*******Table 3***********
**Model 14
ivreg2 h_polcon3 $control_pen (usfdi_Mil_logged_lag_1 = steel_usfdi_Mil_loggedprob), robust first

**Model 28
ivregress 2sls h_polcon3 $control_pen (usfdi_Mil_logged_lag_1 = steel_usfdi_Mil_loggedprob), robust first

ivregress gmm h_polcon3 $control_pen (usfdi_Mil_logged_lag_1 = steel_usfdi_Mil_loggedprob), robust first


*************************

*****keeping variables for abbreviated dataset***********

keep kaopen gdpgrowthannualnygdpmktpkdzg lngdppercap lntrade_gdp sluemtotlzs wdi_inflation primarycompletionratetotalofrel gini china_fin_bln_usd_0510mean eeurop lamerica asia nafrme lnQuantityinMillions lnQuantityinMillions_lag_1 lnQuantityinMillions_ened lnQuantityinMillions_ene_prob steel_lnQuantityinMillionsprob usfdi_Mil_logged usfdi_Mil_logged_lag_1 usfdi_Mil_logged_ened usfdi_Mil_logged_ene_prob steel_usfdi_Mil_loggedprob v2x_polyarchy_1 v2x_libdem_1 v2x_partipdem_1 v2x_delibdem_1 v2x_egaldem_1 e_fh_rol h_polcon3 v2x_corr e_wbgi_pve irst country year

***************************
